package com.braveman.im.ui.adapter;


import android.text.TextUtils;

import com.braveman.im.R;
import com.braveman.im.bean.FriendshipListBean;
import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseSectionQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.qmuiteam.qmui.widget.QMUIRadiusImageView;

import java.util.List;

public class MineFriendsAdapter extends BaseSectionQuickAdapter<FriendshipListBean, BaseViewHolder> {
    private QMUIRadiusImageView avater;

    public MineFriendsAdapter(int layoutResId, int sectionHeadResId, List data) {
        super(layoutResId, sectionHeadResId, data);
    }

    @Override
    protected void convertHead(BaseViewHolder helper, final FriendshipListBean item) {
        helper.setText(R.id.tv_item_home_head, item.header);
    }


    @Override
    protected void convert(BaseViewHolder helper, FriendshipListBean item) {
        helper.setText(R.id.name, !TextUtils.isEmpty(item.friendRemark) ? item.friendRemark : item.friendName);
        avater = helper.getView(R.id.avatar);
        avater.setCircle(false);
        Glide.with(mContext).load(item.friendAvatar).into(avater);
    }


}
